Desktop/Copy of GPS_TRACE/SRC/init.c

Go to the documentation of this file.
00001 #include "lcd.h"
00002 #include "RS232.h"
00003 #include <avr/interrupt.h>
00004 
00005 void delay_ms(unsigned short ms) {
00006    unsigned short outer1, outer2;
00007    outer1 = 200;
00008    while (outer1) {
00009       outer2 = 1000;
00010       while (outer2) {
00011          while ( ms ) ms--;
00012          outer2--;
00013       }
00014       outer1--;
00015    }
00016 }
00017 
00018 
00019 void InitLCDText()
00020 {
00021         lcd_init(LCD_DISP_ON);
00022         lcd_clrscr();
00023         lcd_puts("Welcome to GPS-Trace");
00024         lcd_gotoxy(0,2);
00025         lcd_puts("GPS-Fix: Unknown");
00026         lcd_gotoxy(0,1);
00027         lcd_puts("N: No fix");
00028         lcd_gotoxy(0,3);
00029         lcd_puts("E: No fix");
00030 }
00031 
00032 void InitUarts()
00033 {
00034         uart0_init(); // init USART1
00035         uart1_init(); // init USART0
00036         sei();  // enable interrupts
00037         uart0_send_initial_char();
00038 }
00039 
00040 void initGSM()
00041 {
00042         uart0_puts("AT\r"); //--> Verbinding controleren
00043         delay_ms(1000);
00044     
00045         uart0_puts("AT+CMGF=1\r"); //--> Textmode
00046         delay_ms(1000);
00047 
00048         uart0_puts("AT+CPIN=0000\r"); //--> Pin-code invoeren 
00049         delay_ms(1000);
00050 
00051     uart0_puts("AT+CGMI\r"); //--> Verbinding controleren
00052 }
00053 
00054 //debugger function
00055 void sendTestSMS()
00056 {
00057         uart0_puts("AT+CMGS=xxxxxxxxxxx\r"); //on the place op xxxxxxx place phonenumber to send testsms to 
00058         delay_ms(1000);
00059         uart0_puts("test\x1a");
00060 }

Generated on Fri Aug 17 13:50:54 2007 for GPS TRACE by  doxygen 1.5.3